#include "widget.h"
#include "ui_widget.h"
#include <QDebug>
#include <QResizeEvent>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);

    ui->label->setBuddy(ui->radioButton);
    ui->label_2->setBuddy(ui->radioButton_2);

    //ui->label_4->setAlignment(Qt::AlignTop | Qt::AlignLeft);

    //ui->label_4->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
    //ui->label_4->setText("这是一段文本");
    //ui->label_4->setWordWrap(true);
    //ui->label_4->setIndent(40);
//    QRect rect = this->geometry();
//    ui->label_4->setGeometry(rect.x(),rect.y(),rect.width(),rect.height());
//    QPixmap pixmap(":/linux.jpg");
//    ui->label_4->setPixmap(pixmap);
//    ui->label_4->setScaledContents(true);

//    ui->label->setTextFormat(Qt::PlainText);
//    ui->label->setText("纯文本");

//    ui->label_2->setTextFormat(Qt::RichText);
//    ui->label_2->setText("<b>富文本&nbsp;lxp</b>");

//    ui->label_3->setTextFormat(Qt::MarkdownText);
//    ui->label_3->setText("# markdown文本");

}

Widget::~Widget()
{
    delete ui;
}

//形参event ，包含了触发resize事件，这一时刻窗口尺寸的数值
//void Widget::resizeEvent(QResizeEvent *event)
//{
//    qDebug() << event->size();
//    ui->label_4->setGeometry(0,0,event->size().width(),event->size().height());
//}

